const {SyncHook} = require("tapable");
let hook = new SyncHook(['name']);
hook.tap('1',(name)=>{
    console.log(1,name);
});
hook.tap('2',(name)=>{
    console.log(1,name);
});
hook.intercept({
    call(name){//在每次call之前触发的钩子
        //console.log(name)
    },
    tap({type,fn,name}){//在每次挂载监听的时候触发
        //console.log(type,fn,name);
    },
    register({type,fn,name}){
      console.log({type,fn,name})   ;
      return {type,fn,name};   
    }
});
hook.intercept({
    call(name){//在每次call之前触发的钩子
        //console.log(name)
    },
    tap({type,fn,name}){//在每次挂载监听的时候触发
        //console.log(type,fn,name);
    },
    register({type,fn,name}){
      console.log({type,fn,name})   ;
      return {type,fn,name};   
    }
});
hook.call('zhufeng');